home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / comm / tcp / AmiTCP_bin_22.lha / AmiTCP-2.2 / doc / ncftp.man < prev    next >
Text File  |  1993-10-18  |  39KB  |  1,189 lines

  1.  
  2.  
  3.  
  4. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      NcFTP - Internet file transfer program
  10.  
  11. SYNOPSIS
  12.      ncftp [_p_r_o_g_r_a_m _o_p_t_i_o_n_s] [[_o_p_e_n _o_p_t_i_o_n_s] _h_o_s_t_n_a_m_e[:_p_a_t_h_n_a_m_e]]
  13.  
  14. DESCRIPTION
  15.      _N_c_F_T_P is a user interface  to  the  Internet  standard  _F_i_l_e
  16.      _T_r_a_n_s_f_e_r  _P_r_o_t_o_c_o_l.   This program allows a user to transfer
  17.      files to and from a remote network site,  and  offers  addi-
  18.      tional  features  that  are not found in the standard inter-
  19.      face, _f_t_p.
  20.  
  21. FEATURES
  22.      Program options will be explained later  in  this  document.
  23.      Let's  get  down  to  business and go over the features that
  24.      make this program worthwhile.
  25.  
  26.      Here is the list of section headers;  I  have  my  $MANPAGER
  27.      environment  variable  set  to use ``less -i'' so that I can
  28.      skip to the section I want (otherwise,  /_r_e_g_e_x  commands  to
  29.      the  pager  won't  match  the section headers because of the
  30.      formatting codes; the ``-i'' can search through the  format-
  31.      ting codes)
  32.  
  33.           Establishing the remote connection
  34.           Format of the RC file
  35.           The Recent-sites file
  36.           Redialing a busy remote site
  37.           Supplying a sitename from your shell's command line
  38.           Using Colon-mode
  39.           Using FTP-cat and FTP-more mode
  40.           Supplying a port number with the open command
  41.           Displaying and changing program variables
  42.           Program variables
  43.           Listing a remote directory
  44.           Viewing a remote directory with your pager
  45.           Redisplaying the last directory listing
  46.           Fetching files from the remote host
  47.           Viewing a remote file with your pager
  48.           Creating a message file on the remote host
  49.           Looking up site names and addresses
  50.           Checking the configuration of the program
  51.           Using the command shell
  52.           Customizing the prompt
  53.           Keeping a log of your file transfers
  54.           Program options
  55.           A sample RC file
  56.  
  57. Establishing the remote connection
  58.      Just opening a connection to  a  remote  server  was  incon-
  59.      venient  enough  in the stock _f_t_p program to justify writing
  60.  
  61.  
  62.  
  63. NCEMRSoft                 Last change:                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  71.  
  72.  
  73.  
  74.      this program.  Here at _N_C_E_M_R_S_o_f_t, we want to do our business
  75.      as  quickly  and  painlessly  as possible.  We'd rather save
  76.      time and wear and tear on our metacarpals than bother typing
  77.      entire site names, usernames, and email addresses masquerad-
  78.      ing as passwords, and setting binary mode.
  79.  
  80.      We  made  all  connections  anonymous  by  default,  and  we
  81.      automatically  send  our  email  address for the password on
  82.      those connections.  We allowed for site names to be abbrevi-
  83.      ated.
  84.  
  85.      For each commonly accessed site, you can  put  an  entry  in
  86.      your  program  preferences file (let's call it the ``ncftprc
  87.      file'' or ``RC file'' for short).  To open  the  site,  from
  88.      the command shell all you do is type:
  89.  
  90.           open wuarchive.wustl.edu
  91.  
  92.      or
  93.  
  94.           o wuarchive.wustl.edu
  95.  
  96.      As promised, you can abbreviate that further.  Just use  any
  97.      abbreviation that would match only the site you had in mind.
  98.      For the previous example, you could try:
  99.  
  100.           o wuarc
  101.           o wustl
  102.           o stl
  103.           o wu
  104.  
  105.      Any of those abbreviations  would  open  wuarchive.wustl.edu
  106.      anonymously, sending your anon-password (usually set to your
  107.      email address) as the password.  Keep in mind that the  pro-
  108.      gram tries opening the first site that matches the abbrevia-
  109.      tion you supplied.  So:
  110.  
  111.           o w
  112.  
  113.      might match a site named  bowser.nintendo.jp  if  that  site
  114.      appeared before your entry for wuarchive.wustl.edu.
  115.  
  116.      Most of the time we open remote sites anonymously, but there
  117.      are times where you need to specifically open a site with an
  118.      actual username and password.  Let's say  my  partner,  Phil
  119.      Dietz, wants to FTP something out of my account.  Perhaps he
  120.      wants to fetch the latest version  of  the  source  code  to
  121.      _N_c_F_T_P  so  he  can  optimize  something or add a new feature
  122.      behind my  back.   Since  the  program  opens  remote  sites
  123.      anonymously  by  default  (actually,  you  can  change  this
  124.      behavior; more on that later), he would have  to  specify  a
  125.      flag  to  the  _o_p_e_n command so he can supply my username and
  126.  
  127.  
  128.  
  129. NCEMRSoft                 Last change:                          2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  137.  
  138.  
  139.  
  140.      password.  He would try:
  141.  
  142.           o -u sphygmomanometer.unl.edu
  143.  
  144.      or, more likely:
  145.  
  146.           o -u sph
  147.  
  148.      Then the program would prompt him  for  a  username  (login,
  149.      whatever) and a password:
  150.  
  151.           Login Name (pdietz): mgleason
  152.           Password: ********
  153.  
  154.      If he got it right, he could raid my stuff.   If  not,  he'd
  155.      probably  drop  me  an  email  asking me to quit changing my
  156.      password so often.
  157.  
  158.      There are even times where you want to  FTP  from  your  own
  159.      account,  like if you are debugging an FTP client you wrote.
  160.      At this prompt:
  161.  
  162.           Login Name (mgleason):
  163.  
  164.      I could just hit return to tell  the  program  that  I  want
  165.      ``mgleason'' as my username, then I would enter my password.
  166.  
  167. Format of the RC file
  168.      This release of the program is somewhat compatible with  the
  169.      stock _f_t_p program's .netrc file.  However, I can promise you
  170.      that in the near future the program will use a  new  format,
  171.      so don't invest too much time in it.
  172.  
  173.      The  RC  file  can  be  named  ``ncftprc'',  ``netrc'',   or
  174.      ``.ncftprc'',  but  it is usually named ``.netrc'' so it can
  175.      be used with the stock _f_t_p  program.   _N_c_F_T_P  looks  in  the
  176.      current  working  directory for any of those files, and then
  177.      in your home directory, and after that it gives up (which is
  178.      OK, because RC files aren't mandatory).
  179.  
  180.      The file usually starts with #_s_e_t and #_u_n_s_e_t  commands  that
  181.      do  things  to  the  programs variables.  The reason for the
  182.      ``#'' is so the stock _f_t_p program will think they  are  com-
  183.      ments.  You might have this appearing as the first few lines
  184.      in your RC file (I'll explain later):
  185.  
  186.           #set debug 1
  187.           #set pager "less -EMi"
  188.           #unset startup-msg
  189.  
  190.      After those, you put in machine entries  for  each  of  your
  191.      favorite    sites.     Let's    put    in   an   entry   for
  192.  
  193.  
  194.  
  195. NCEMRSoft                 Last change:                          3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  203.  
  204.  
  205.  
  206.      wuarchive.wustl.edu.  First you would put:
  207.  
  208.           machine wuarchive.wustl.edu
  209.  
  210.      Then you could put in your username, password,  and  account
  211.      if you like:
  212.  
  213.           user anonymous
  214.           password -mgleason@cse.unl.edu
  215.           account wuarc.does.not.use.accounts
  216.  
  217.      Following that, you would add the startup macro that is  run
  218.      each  time you connect to wuarchive.  You must start it with
  219.      this line:
  220.  
  221.           macdef init
  222.  
  223.      Then put in the commands you want to do:
  224.  
  225.           cd /graphics/gif
  226.           ls -lt
  227.  
  228.      After that, you end the macro  with  a  blank  line  (impor-
  229.      tant!).  The finished machine entry would look like the fol-
  230.      lowing.  To make the transition to the impending new  format
  231.      less painful, I recommend you adhere to this format:
  232.  
  233.           machine wuarchive.wustl.edu
  234.                 user anonymous
  235.                 password -mgleason@cse.unl.edu
  236.                 account wuarc.does.not.use.accounts
  237.                 macdef init
  238.                       cd /graphics/gif
  239.                       ls -lt
  240.                 (_m_a_n_d_a_t_o_r_y _b_l_a_n_k _l_i_n_e _t_o _e_n_d _t_h_e _m_a_c_r_o)
  241.  
  242.      Of  course,  if  all  you  want  to  do  is  open  wuarchive
  243.      anonymously,  you  needn't bother with the ``user'', ``pass-
  244.      word'', and ``account'' lines.  You may want to put them  in
  245.      if  you  plan  on  using the stock _f_t_p program, though.  Try
  246.      something like this:
  247.  
  248.           machine wuarchive.wustl.edu
  249.                 macdef init
  250.                       cd /graphics/gif
  251.                       ls -lt
  252.                 (_m_a_n_d_a_t_o_r_y _b_l_a_n_k _l_i_n_e _t_o _e_n_d _t_h_e _m_a_c_r_o)
  253.  
  254.      You can tell the program to not run the startup macro if you
  255.      supply -i to the _o_p_e_n command.
  256.  
  257.  
  258.  
  259.  
  260.  
  261. NCEMRSoft                 Last change:                          4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  269.  
  270.  
  271.  
  272.      Really, you should only bother adding entries for sites that
  273.      you  want  to  run startup macros upon connection.  The next
  274.      section explains why.
  275.  
  276. The Recent-sites file
  277.      Each time you open a site, the program saves the name of the
  278.      site  and the last directory you were in to the _r_e_c_e_n_t-_s_i_t_e_s
  279.      _f_i_l_e which is named .ncrecent and placed in your home direc-
  280.      tory.   The  program  saves  a predetermined number of these
  281.      sites in the file, and when it reaches the  limit,  it  dis-
  282.      cards the oldest entry so it can add a new one.
  283.  
  284.      You can just go ahead and use the name of the site you  want
  285.      with  the  _o_p_e_n command if you know it is in the _r_e_c_e_n_t-_f_i_l_e
  286.      (and you can abbreviate the name, just like those in the  RC
  287.      file).  But if you cannot remember what the name of the site
  288.      you want, all you do is run the _o_p_e_n command  with  no  site
  289.      parameter:
  290.  
  291.           open
  292.  
  293.      This will pop up a list of the sites in the _r_e_c_e_n_t-_f_i_l_e, and
  294.      sites  in  your  RC file.  At the open prompt, just type the
  295.      name (or an abbreviation of that name) or the number preced-
  296.      ing the site name to open that site.  After opening the site
  297.      you wanted, the program sets the remote working directory to
  298.      the same one you left in the last time you called.
  299.  
  300.      If you don't like the idea of having the  sites  you  called
  301.      stored on disk, you can turn this feature off using an _u_n_s_e_t
  302.      command, explained later.
  303.  
  304. Redialing a busy remote site
  305.      Some remote sites limit the number of leeches, er, anonymous
  306.      connections  at  a  time to reduce the load on the host com-
  307.      puter.  You can use the _o_p_e_n  command's  redial  feature  to
  308.      keep  attempting connections until you get on, although that
  309.      is not a very polite thing to do.  The simplest  way  to  do
  310.      this would be to just supply the -r option:
  311.  
  312.           open -r wuarc
  313.  
  314.      There are also options you can use to tweak redial.  The  -d
  315.      flag  sets  the  delay between dials, and the -g flag sets a
  316.      limit on how many dials should be attempting  before  giving
  317.      up.   If you don't supply -g the program will dial a day and
  318.      forever (which my Number Theory professor, Dr. Mientka, says
  319.      is longer than forever and a day) until it connects success-
  320.      fully, or until you get sick of waiting and hit  the  inter-
  321.      rupt key (usually ^C).
  322.  
  323.  
  324.  
  325.  
  326.  
  327. NCEMRSoft                 Last change:                          5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  335.  
  336.  
  337.  
  338.      This example dials wuarchive every ten  minutes,  giving  up
  339.      after twenty attempts.  Note that the redial delay is speci-
  340.      fied in seconds:
  341.  
  342.           open -r -d 600 -g 20 wuarc
  343.  
  344.      Please be considerate when you use redialing, so  you  won't
  345.      tax  the  network.  Site administrators can and do get angry
  346.      when they get flooded with connections.
  347.  
  348. Supplying a sitename from your shell's command line
  349.      When you run the program:
  350.  
  351.           ncftp
  352.  
  353.      by itself does nothing and waits for you to type commands to
  354.      the  program's  own shell.  Just like the stock _f_t_p program,
  355.      you can supply a site name on the command line:
  356.  
  357.           ncftp wuarchive.wustl.edu
  358.  
  359.      You can also use abbreviations as usual:
  360.  
  361.           ncftp wuarc
  362.  
  363.      This is equivalent to running the program, then  issuing  an
  364.      _o_p_e_n command to open wuarchive.
  365.  
  366. Using Colon-mode
  367.      The _o_p_e_n command is not a one-trick pony.  Another option is
  368.      what  I  call _c_o_l_o_n-_m_o_d_e.  This feature is used (most of the
  369.      time) from your shell's command line.
  370.  
  371.      In ancient times, way back during the Disco era,  you  could
  372.      use a program called _t_f_t_p to fetch a file using the Internet
  373.      standard _T_r_i_v_i_a_l _F_i_l_e _T_r_a_n_s_f_e_r _P_r_o_t_o_c_o_l. You could use  that
  374.      program to do something like this from within its shell:
  375.  
  376.           get wuarchive.wustl.edu:/graphics/gif/README
  377.  
  378.      and that would call wuarchive and fetch the README file.
  379.  
  380.      You can use this program to do  the  same  thing  from  your
  381.      shell's command line:
  382.  
  383.           csh> ncftp wuarchive.wustl.edu:/graphics/gif/README
  384.           csh> head README
  385.  
  386.      This tells your shell, in this case the ``c-shell''  to  run
  387.      _N_c_F_T_P,     which     would     open     wuarchive,     fetch
  388.      /graphics/gif/README and write  the  file  ./README  in  the
  389.      current  working directory, and then exits.  This is nice if
  390.  
  391.  
  392.  
  393. NCEMRSoft                 Last change:                          6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  401.  
  402.  
  403.  
  404.      you don't want to browse around the  remote  site,  and  you
  405.      know  exactly want you want.  It would also come in handy in
  406.      shell scripts, where you don't want  to  enter  the  command
  407.      shell, and might not want the program to spew output.
  408.  
  409.      You can use _c_o_l_o_n-_m_o_d_e to set the  starting  remote  working
  410.      directory also:
  411.  
  412.           csh> ncftp wuarchive.wustl.edu:/graphics/gif
  413.  
  414.      This would run the program, open wuarchive, and  _c_d  to  the
  415.      gif  directory,  then run the program's command shell so you
  416.      can browse.
  417.  
  418.      _C_o_l_o_n-_m_o_d_e is also available from within the program's  com-
  419.      mand shell.  At a prompt you can do stuff like this:
  420.  
  421.           ncftp> open wuarchive.wustl.edu:/graphics/gif/README
  422.           ncftp> o wuarc:/graphics/gif
  423.  
  424. Using FTP-cat and FTP-more mode
  425.      There are times where you might  not  want  the  program  to
  426.      write a _c_o_l_o_n-_m_o_d_e file in the current working directory, or
  427.      perhaps you want to pipe the output of a  remote  file  into
  428.      something  else.  _C_o_l_o_n-_m_o_d_e has options to do this.  It was
  429.      inspired by the guy who wrote the _f_t_p_c_a_t perl  script.   The
  430.      -c  option tells the program to write on the standard output
  431.      stream.  The -m option pipes the file into your pager  (like
  432.      _m_o_r_e)  Of  course  this  won't  work  if  the thing you give
  433.      _c_o_l_o_n-_m_o_d_e is a directory!  This example just dumps a remote
  434.      file to stdout:
  435.  
  436.           csh> ncftp -c wuarc:/graphics/gif/README
  437.           ...
  438.           csh>
  439.  
  440.      This example redirects a remote file into a different  loca-
  441.      tion:
  442.  
  443.           csh> ncftp -c wu:/README > ~pdietz/thesis.tex
  444.  
  445.      This one shows how to use a pipeline:
  446.  
  447.           csh> ncftp -c wuarc:/README | tail | wc -l
  448.           10
  449.           csh>
  450.  
  451.      This shows how to page a remote file:
  452.  
  453.           csh> ncftp -m wuarc:/graphics/gif/README
  454.           ...
  455.           csh>
  456.  
  457.  
  458.  
  459. NCEMRSoft                 Last change:                          7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  467.  
  468.  
  469.  
  470. Supplying a port number with the open command
  471.      This option just didn't fit anywhere else, so to finish  out
  472.      the  open  command,  -p lets you supply a port number if you
  473.      have to _f_t_p to a site  using  an  nonstandard  port  number.
  474.      Personally,  I  have  yet  to use feature, but its there for
  475.      compatibility with the stock _f_t_p program.
  476.  
  477. Displaying and changing program variables
  478.      Now I'll explain the commands unique to _N_c_F_T_P.   The  others
  479.      should  perform the same as they would in the stock _f_t_p pro-
  480.      gram; consult  the  man  page  for  it  if  you  want  those
  481.      explained, or use the _h_e_l_p command for a brief blurb.
  482.  
  483.      The _s_h_o_w command is used to display  program  variables  and
  484.      their values.
  485.  
  486.           show all
  487.  
  488.      or
  489.  
  490.           show
  491.  
  492.      would display all the variables with their values.
  493.  
  494.           show _v_a_r_1 _v_a_r_2 ... _v_a_r_N
  495.  
  496.      would display each specified variable and its value.
  497.  
  498.      The _s_e_t command changes the value  of  a  program  variable.
  499.      Its syntax is:
  500.  
  501.           set _v_a_r_n_a_m_e _v_a_l_u_e
  502.  
  503.      For Boolean or Integer variables,
  504.  
  505.           set _v_a_r_n_a_m_e
  506.  
  507.      would set the value of the variable _v_a_r_n_a_m_e to 1 (true).
  508.  
  509.      The _u_n_s_e_t command can be used to set  the  variable  to  its
  510.      default value, or for Boolean and Integer variables, set the
  511.      value of the variable to 0 (false).  For  String  variables,
  512.      you can use this to set the value to an empty string.
  513.  
  514.      You can use any of those three commands in both the  command
  515.      shell, or in the RC file with a ``#'' prepended.
  516.  
  517. Program variables
  518.      Each variable can be one of the following types:
  519.  
  520.      Boolean:
  521.           Can be ``on'' or ``off'' (you can  also  use  ``1''  or
  522.  
  523.  
  524.  
  525. NCEMRSoft                 Last change:                          8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  533.  
  534.  
  535.  
  536.           ``0'').
  537.  
  538.      Integer:
  539.           Can be any positive or negative number, or 0.
  540.  
  541.      String:
  542.           Is a string of characters.  If the string needs to have
  543.           a  space in it, make sure you surround the whole string
  544.           with double quotes in a _s_e_t command.
  545.  
  546.      Variables follow.  Some variables are explained later in the
  547.      relevant sections.
  548.  
  549.      _a_n_o_n-_o_p_e_n (Boolean)
  550.           Tells whether the default login mode  is  anonymous  if
  551.           on,  or  if  off,  will prompt for a username/password.
  552.           You can always override this by using either -a  or  -u
  553.           with the _o_p_e_n command.
  554.  
  555.      _a_n_o_n-_p_a_s_s_w_o_r_d (String)
  556.           Sends this as the password when you login  anonymously.
  557.           By default this is your email address.
  558.  
  559.      _a_n_s_i-_e_s_c_a_p_e_s (Boolean)
  560.           If on, the program can  use  boldface,  underline,  and
  561.           inverse text.
  562.  
  563.      _a_u_t_o-_b_i_n_a_r_y (Boolean)
  564.           If on, sets the transfer type to  binary  mode  immedi-
  565.           ately after connection.
  566.  
  567.      _d_e_b_u_g (Integer)
  568.           Sets the debugging level.
  569.  
  570.      _g_a_t_e_w_a_y-_l_o_g_i_n (String)
  571.           Tells which username to use when  logging  in  to  your
  572.           firewall gateway host.
  573.  
  574.      _g_a_t_e_w_a_y-_h_o_s_t (String)
  575.           The site which is acting as your firewall  gateway,  or
  576.           empty if you aren't using one.
  577.  
  578.      _l_o_c_a_l-_d_i_r (String)
  579.           The current local working directory.   I  like  to  set
  580.           this  from my RC file, so all my files go into my down-
  581.           load directory.
  582.  
  583.      _l_o_g_f_i_l_e (String)
  584.           The name of your personal transfer log, or empty if you
  585.           aren't using a transfer log.
  586.  
  587.      _l_o_g_s_i_z_e (Integer)
  588.  
  589.  
  590.  
  591. NCEMRSoft                 Last change:                          9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  599.  
  600.  
  601.  
  602.           The maximum ceiling of your log file, before  the  pro-
  603.           gram removes old entries.
  604.  
  605.      _m_p_r_o_m_p_t (Boolean)
  606.           If on, prompts for each remote  file  expanded  from  a
  607.           wildcard globbing expression.
  608.  
  609.      _n_e_t_r_c (String, Read-only)
  610.           Tells you the name of the RC file in use.
  611.  
  612.      _p_a_g_e_r (String)
  613.           The pathname and flags of the program used  to  display
  614.           output  one  screenful  at  a time.  The default is the
  615.           value of your $PAGER environment variable.
  616.  
  617.      _p_r_o_m_p_t (String)
  618.           The prompt specification that expands into the prompt.
  619.  
  620.      _p_r_o_g_r_e_s_s-_r_e_p_o_r_t_s (Integer)
  621.           Which progress meter to use, or 0  if  you  don't  want
  622.           progress reports during file transfers.
  623.  
  624.      _r_e_c_e_n_t-_l_i_s_t (Boolean)
  625.           If on, uses and updates the _r_e_c_e_n_t-_f_i_l_e.
  626.  
  627.      _r_e_m_o_t_e-_i_s-_u_n_i_x (Boolean)
  628.           Set automatically by the program upon  connection,  you
  629.           may  need to use this in a startup macro if the program
  630.           guessed that a remote site was UNIX when it  really  is
  631.           not.
  632.  
  633.      _s_t_a_r_t_u_p-_m_s_g (Boolean)
  634.           If on, prints the opening message and tip.
  635.  
  636.      _t_i_p_s (Boolean)
  637.           If on, prints a tip on how to use  the  program  better
  638.           each time you run the program.
  639.  
  640.      _t_y_p_e (String)
  641.           The name of the file transfer  mode  in  use,  such  as
  642.           ``binary'' or ``ascii''.
  643.  
  644.      _v_e_r_b_o_s_e (String/Integer)
  645.           Controls the amount of output spewed  by  the  program.
  646.           You  can  supply either the first character of the name
  647.           of the verbosity level, or its number:
  648.  
  649.           _Quiet (-1)
  650.                Won't print any output at all, even  if  an  error
  651.                occurs.
  652.  
  653.           _Errors Only (0)
  654.  
  655.  
  656.  
  657. NCEMRSoft                 Last change:                         10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  665.  
  666.  
  667.  
  668.                No output, except when errors occur.
  669.  
  670.           _Terse (1)
  671.                Prints errors, and useful output from  the  remote
  672.                host.
  673.  
  674.           _Verbose (2)
  675.                Prints  everything,  even  junk  output  from  the
  676.                remote end.
  677.  
  678. Listing a remote directory
  679.      The _l_s and _d_i_r commands perform in a similar manner to those
  680.      of the stock _f_t_p program.
  681.  
  682.      The _l_s command sends the FTP command ``NLST'' for you.  This
  683.      command  has  been set so that it defaults to always listing
  684.      files in columns (this is the -C option given to the UNIX _l_s
  685.      command)  and  appending  metacharacters  to  each item name
  686.      (this is the -F option), so you  can  see  which  items  are
  687.      directories, files, links, etcetera.  If you don't want your
  688.      items columnized, you can try using the -1 option with _l_s to
  689.      print one item per line.
  690.  
  691.      The _d_i_r command sends the  FTP  command  ``LIST''  for  you,
  692.      which  instead  of  printing just item names, it prints item
  693.      sizes, owners, dates, and permissions as well.  This command
  694.      is equivalent to ``ls -l'' on most remote systems.
  695.  
  696.      The usage for both commands is the same.  Here  is  the  one
  697.      for _l_s:
  698.  
  699.           ls [-_f_l_a_g_s] [_d_i_r_e_c_t_o_r_y _a_n_d _f_i_l_e _n_a_m_e_s] [_r_e_d_i_r_e_c_t_i_o_n]
  700.  
  701.      Note that in this program, you can  supply  both  flags  and
  702.      items to list in the same command.  The stock version of _f_t_p
  703.      doesn't let you do this:
  704.  
  705.           ls -lrt /info-mac/help
  706.  
  707.      Another thing that the program does which the others  should
  708.      have done is let you supply more than one item:
  709.  
  710.           ls -lrt /info-mac/help /pub /info-mac/README
  711.  
  712.      You can also redirect the output into a  file,  or  pipe  it
  713.      into something.  This example shows how to list the contents
  714.      of the current remote directory, and save the output into  a
  715.      file in the current local directory:
  716.  
  717.           ls -t >ls.out
  718.  
  719.  
  720.  
  721.  
  722.  
  723. NCEMRSoft                 Last change:                         11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  731.  
  732.  
  733.  
  734.      Note that for this to work,  there  must  be  no  whitespace
  735.      between  the  ``>'' and the filename, unlike your shell com-
  736.      mand line which allows for extra whitespace.  This  will  be
  737.      (actually, is) fixed in a future version of the program.
  738.  
  739.      These examples show how to use a pipe:
  740.  
  741.           ls -t |tail
  742.           dir -t "|less -CM"
  743.           ls -t "|tail | wc"
  744.  
  745.      Like the redirection example, there must  be  no  whitespace
  746.      between  the first pipe character and the rest of the stuff.
  747.      The trick is that it has to appear as one  argument  to  the
  748.      commands.   The second and third examples illustrate the use
  749.      of double quotes to squeeze extra parameters in.  The second
  750.      example  can  be  done  without  all  that  typing.  See the
  751.      descriptions of the _p_d_i_r and _p_l_s commands below.
  752.  
  753. Viewing a remote directory with your pager
  754.      Didn't you hate it when you listed a remote directory,  only
  755.      to  have most of the stuff scrolled off your terminal before
  756.      you could read it?  The _p_l_s and _p_d_i_r commands take  care  of
  757.      this  for  you.   As  you  might  have guessed, they perform
  758.      exactly like their regular counterparts, only you view  them
  759.      with  your  pager.   The  pager  to use is controlled by the
  760.      _p_a_g_e_r program variable.
  761.  
  762. Redisplaying the last directory listing
  763.      The program saves the listing into a local buffer, so if you
  764.      need  to  see  it again (probably forgot about _p_d_i_r) you can
  765.      use the _r_e_d_i_r and _p_r_e_d_i_r commands for this.
  766.  
  767. Fetching files from the remote host
  768.      The _g_e_t and _m_g_e_t retrieve remote files for you.   The  usage
  769.      for _g_e_t is:
  770.  
  771.           get remote-file [local-file or redirection]
  772.  
  773.      To  fetch  /pub/README  and  write  it  as  a   file   named
  774.      ./junk/readme, try:
  775.  
  776.           get /pub/README ./junk/readme
  777.  
  778.      To fetch /pub/README and write it as ./README, just do:
  779.  
  780.           get /pub/README
  781.  
  782.      This lets you fetch a file using  its  whole  pathname,  and
  783.      write  a copy of it in the current directory, without having
  784.      to bother with typing a local  filename.   In  the  unlikely
  785.      event  that  you have write permission to a directory called
  786.  
  787.  
  788.  
  789. NCEMRSoft                 Last change:                         12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  797.  
  798.  
  799.  
  800.      /pub on your local machine, it  would  write  ``README''  in
  801.      that directory.
  802.  
  803.      Most of the time the file you want will be  in  the  current
  804.      remote directory, so you can just do these:
  805.  
  806.           get README
  807.           get README ./junk/readme
  808.  
  809.      You can also use a redirection for _g_e_t, just  like  you  can
  810.      with the _l_s, _d_i_r, and _r_e_d_i_r commands.  As described earlier,
  811.      you have to conform to the format below for this release  of
  812.      the program:
  813.  
  814.           get README >/dev/null
  815.           get README |head
  816.           get README "|head -8"
  817.           get README "|less -EMi"
  818.  
  819.      The  last  example  is  facilitated  by  the  _p_a_g_e   command
  820.      described later.
  821.  
  822.      The _g_e_t command can also use a  wildcard  expression  in  an
  823.      attempt  to match exactly one remote file.  I call it ``Poor
  824.      Man's File Completion.'' If you've done  a  remote  listing,
  825.      and  you  decide  you want to download a file by the name of
  826.      ``obnoxiouslylongpackagename.tar.Z'', you can  use  ``PMFC''
  827.      to  save  some  keystrokes.   Choose an expression that will
  828.      only match that one file, then use it with _g_e_t:
  829.  
  830.           get obn*.Z a.tar.Z
  831.  
  832.      If your pattern was unique, _g_e_t will fetch that  file  only.
  833.      If  the pattern matched more than one file, the program will
  834.      bitch and moan.
  835.  
  836.      The _m_g_e_t command is used to fetch many files at a time.  The
  837.      difference  between  _g_e_t and _m_g_e_t is that _g_e_t lets you write
  838.      only one file, but you can put it in a different  directory,
  839.      while  _m_g_e_t  fetches  many files, always writing them in the
  840.      current  local  directory.   This  example  fetches  several
  841.      remote files at once:
  842.  
  843.           mget a.file.Z b.file.Z c.tar d.tar.Z
  844.  
  845.      The _m_g_e_t command, and its ugly sisters, _m_p_u_t and _m_d_e_l_e_t_e let
  846.      you  use wildcard expressions.  I could have done the previ-
  847.      ous example as:
  848.  
  849.           mget *.Z c.tar
  850.  
  851.  
  852.  
  853.  
  854.  
  855. NCEMRSoft                 Last change:                         13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  863.  
  864.  
  865.  
  866.      instead.  The ``m'' commands will verify each file,  if  you
  867.      have the program variable _m_p_r_o_m_p_t set.
  868.  
  869. Viewing a remote file with your pager
  870.      If you would like to read a file on the remote host  without
  871.      saving  a  copy  of it on your machine, you can use the _p_a_g_e
  872.      (or _m_o_r_e if you wish) command:
  873.  
  874.           page README
  875.           page obn*README
  876.           page README.Z
  877.  
  878.      The second example show that you can use ``PMFC''  like  you
  879.      can  for  _g_e_t.  The third example will work also, because if
  880.      the program knows how to decompress the file, it will do  so
  881.      before feeding it to your pager.  As stated earlier, you can
  882.      change the program to use to page  by  setting  the  program
  883.      variable _p_a_g_e_r.
  884.  
  885. Creating a message file on the remote host
  886.      Use the _c_r_e_a_t_e an empty file on the remote site.   Sometimes
  887.      it  is  necessary  to leave a note if you can't get in touch
  888.      with the remote site's administrator.  For example if a file
  889.      is corrupted, you could try:
  890.  
  891.           create Foo.tar_is_corrupt
  892.  
  893.      in hopes that the original uploader will replace it.
  894.  
  895. Looking up site names and addresses
  896.      You can use the program's  builtin  mini-_n_s_l_o_o_k_u_p  facility.
  897.      If  you  wanted  to know the site's IP number, but only knew
  898.      the name you could do:
  899.  
  900.           lookup cse.unl.edu
  901.  
  902.      This would spit out IP number for that site,  in  this  case
  903.      ``129.93.1.12''.   If  you needed to know what a site's name
  904.      was, but only knew the IP number, try:
  905.  
  906.           lookup 129.93.1.12
  907.  
  908.      This would spit out the name for that  site,  in  this  case
  909.      ``cse.unl.edu''.
  910.  
  911. Checking the configuration of the program
  912.      Use the _v_e_r_s_i_o_n command to  print  version  and  compilation
  913.      information  about  the  program.   This  will also tell you
  914.      which optional features are compiled into the program,  such
  915.      as  logging  to the system log and which command line editor
  916.      (if any) has been installed.
  917.  
  918.  
  919.  
  920.  
  921. NCEMRSoft                 Last change:                         14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  929.  
  930.  
  931.  
  932.      The author's email address is listed, and  if  you  need  to
  933.      report something, send the output of this command along with
  934.      your message.
  935.  
  936. Using the command shell
  937.      Just like the stock _f_t_p program, you  type  commands  to  it
  938.      until  you get bored and hit either ^D or type the _q_u_i_t com-
  939.      mand.
  940.  
  941.      The program supports links to popular command  line  editing
  942.      libraries.   If  the  person  who  compiled  it  went to the
  943.      effort, you will be able to edit the command line with arrow
  944.      keys and other editing commands, and also scroll up and down
  945.      in the command line history, usually with the  up  and  down
  946.      arrows.   You can check the _v_e_r_s_i_o_n command to see if either
  947.      ``GETLINE'' or ``READLINE'' are installed.
  948.  
  949. Customizing the prompt
  950.      You can set the shell's prompt string to whatever you  like.
  951.      You  can  use  several metacharacters that expand into some-
  952.      thing  each  prompt.   The  ``%''  flags   are   passed   to
  953.      _s_t_r_f_t_i_m_e(3),  so  you can put the date or time in the prompt
  954.      formatted as you like it:
  955.  
  956.           set prompt "%I:%M ncftp>"
  957.  
  958.      That would the current time in the prompt.
  959.  
  960.      The ``@'' flags are expanded by the program itself.   Here's
  961.      the list of them.
  962.  
  963.      If you have an ANSI-compatible terminal,  or  you  have  the
  964.      program  variable  _a_n_s_i-_e_s_c_a_p_e_s set, you can use @B, @I, and
  965.      @U to turn on boldface, inverse, and underline text  respec-
  966.      tively (otherwise they won't insert anything).  You can also
  967.      use @R to turn on inverse (reverse) text.  @P sets the  text
  968.      back to plain text.
  969.  
  970.      @D Inserts the full path of the  current  remote  directory.
  971.      The  @J flag is similar except it inserts only the directory
  972.      name.
  973.  
  974.      @H Inserts the name of the remote host.  @C inserts the host
  975.      and  current  directory  path  in _c_o_l_o_n-_m_o_d_e format, such as
  976.      ``cse.unl.edu:/pub/mgleason'', or ``(not connected)''.   The
  977.      @c    flag    is    similar,    only    it    will    insert
  978.      ``cse.unl.edu:/pub/mgleason'' and a  newline  if  connected,
  979.      otherwise  it  prints nothing.  The default prompt uses this
  980.      flag to print a two line prompt when  connected  and  a  one
  981.      line prompt when not connected.
  982.  
  983.  
  984.  
  985.  
  986.  
  987. NCEMRSoft                 Last change:                         15
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  995.  
  996.  
  997.  
  998.      @E or @!  inserts the event number (how many commands you've
  999.      typed).
  1000.  
  1001.      @M inserts ``(Mail) '' if mail has arrived since running the
  1002.      program.
  1003.  
  1004.      @N inserts a newline character.
  1005.  
  1006. Keeping a log of your file transfers
  1007.      You can have the program keep a personal log file.   I  find
  1008.      it  is  useful  so  I can see where I got a certain file, or
  1009.      what the name of that site was I called two weeks ago.
  1010.  
  1011.      To use a log, add:
  1012.  
  1013.           #set logfile ~/.ftplog
  1014.  
  1015.      (or whatever you want to name the log) to your RC  file.   I
  1016.      don't want my log growing too large and using up all my disk
  1017.      space, so I also have:
  1018.  
  1019.           #set logsize 10240
  1020.  
  1021.      in my RC file.  If you set the  limit  on  the  maximum  log
  1022.      size,  the  program  will keep the log file at or below that
  1023.      size, discarding old entries.
  1024.  
  1025.      Note that this is different from having SYSLOG appear in the
  1026.      _v_e_r_s_i_o_n command's output.  When this is on, your actions are
  1027.      recorded to the system log, so your system administrator can
  1028.      make sure you aren't doing anything ``bad.''
  1029.  
  1030. Program options
  1031.      Remember that you can treat the command line  like  an  _o_p_e_n
  1032.      command,  so  all  lowercase  options are passed to the _o_p_e_n
  1033.      command, and the uppercase options are handled by  the  main
  1034.      program.   The  uppercase options are described below; refer
  1035.      to the _o_p_e_n command for descriptions of its options.
  1036.  
  1037.      -D _x sets the debugging level to _x.
  1038.  
  1039.      -H   runs the _v_e_r_s_i_o_n command and exits, so you can save the
  1040.           output of it to use when you need to mail me something.
  1041.  
  1042.      -I   toggles the mprompt variable; this is provided for com-
  1043.           patibility with ``ftp -i''.
  1044.  
  1045.      -N   disables reading of the RC file; this is  provided  for
  1046.           compatibility with ``ftp -n''.
  1047.  
  1048.      -V _x sets verbosity to level _x (-1,  0,  1,  2)  or  (quiet,
  1049.           errs,  terse,  verbose).   See  the  description of the
  1050.  
  1051.  
  1052.  
  1053. NCEMRSoft                 Last change:                         16
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  1061.  
  1062.  
  1063.  
  1064.           _v_e_r_b_o_s_e program variable for more information.
  1065.  
  1066.      Here  are  some  example  command  lines.   Again,  see  the
  1067.      description  of  the _o_p_e_n command (especially _c_o_l_o_n-_m_o_d_e and
  1068.      _F_T_P-_c_a_t _m_o_d_e) and all its functions for more information.
  1069.  
  1070.      This just enters the _N_c_F_T_P command shell:
  1071.  
  1072.           csh> ncftp
  1073.  
  1074.      This fetches CONTENTS and then quits:
  1075.  
  1076.           csh> ncftp cse.unl.edu:/pub/mgleason/CONTENTS
  1077.  
  1078.      Some others examples, with open  options  and  main  program
  1079.      options mixed in:
  1080.  
  1081.           csh> ncftp -V quiet -u ftp.unl.edu
  1082.           csh> ncftp -c cse.unl.edu:/pub/mgleason/CONTENTS
  1083.           csh> ncftp -D 2 -r -d 120 -g 10 -N ftp.unl.edu
  1084.  
  1085. A sample RC file
  1086.      Here is a sample RC file:
  1087.  
  1088.           #set logfile ~/.ftplog
  1089.           #set progress-reports 2
  1090.           #set local-dir /usr/tmp/zz
  1091.           #set prompt "@B@E @UNcFTP@P @B@M@D@P ->"
  1092.  
  1093.           machine sumex-aim.stanford.edu
  1094.                 macdef init
  1095.                       cd /info-mac
  1096.                       get ./help/recent-files.txt "|grep -v '.abs' > sumex
  1097.                       !less sumex
  1098.                       pwd
  1099.  
  1100.           # This site is in here just so I can use ``apple''
  1101.           # as an abbreviation.
  1102.           machine ftp.apple.com
  1103.  
  1104.           # NcFTP will only ask for your password:
  1105.           machine cse.unl.edu
  1106.                 login mgleason
  1107.  
  1108.           # You can supply a login and a password:
  1109.           machine fake.machine.unl.edu
  1110.                 login mgleason
  1111.                 password mypass
  1112.                 macdef init
  1113.                 cd ./foo/bar
  1114.  
  1115.           # If an antiquated non-UNIX machine doesn't use
  1116.  
  1117.  
  1118.  
  1119. NCEMRSoft                 Last change:                         17
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. NcFTP(1)                 USER COMMANDS                   NcFTP(1)
  1127.  
  1128.  
  1129.  
  1130.           # the "SYST" command, you may need to unset
  1131.           # remote-is-unix, if the remote host complains
  1132.           # about ``ls -CF''.
  1133.           machine some.vms.unl.edu
  1134.                 macdef init
  1135.                 unset remote-is-unix
  1136.  
  1137.  
  1138. AUTHORS
  1139.      _N_c_F_T_P   was   written    by    Mike    Gleason,    _N_C_E_M_R_S_o_f_t
  1140.      (mgleason@cse.unl.edu),  and based on code by the authors of
  1141.      the _f_t_p from the BSD 4.3 distribution.  _N_c_F_T_P is copyrighted
  1142.      1992,  1993  by  NCEMRSoft  and 1985, 1989 by the Regents of
  1143.      California.
  1144.  
  1145.      Ideas and some code contributed  by  Phil  Dietz,  _N_C_E_M_R_S_o_f_t
  1146.      (pdietz@cse.unl.edu).   Testing  and  debugging done by Phil
  1147.      and Kok Hon Yin (hkok@cse.unl.edu).
  1148.  
  1149.      Extensive man page formatting work  by  DaviD  W.  Sanderson
  1150.      (dws@ssec.wisc.edu).
  1151.  
  1152. BUGS
  1153.      Correct execution  of  many  commands  depends  upon  proper
  1154.      behavior by the remote server.
  1155.  
  1156.      The remote server may drop the connection if you take a long
  1157.      time to page remote files.
  1158.  
  1159.      Termcap padding is not correctly displayed.
  1160.  
  1161.      There  are  no  such  sites  named   _b_o_w_s_e_r._n_i_n_t_e_n_d_o._j_p   or
  1162.      _s_p_h_y_g_m_o_m_a_n_o_m_e_t_e_r._u_n_l._e_d_u.
  1163.  
  1164. SEE ALSO
  1165.      _s_t_r_f_t_i_m_e(3),  _f_t_p_d(8),  _f_t_p(1),  _n_s_l_o_o_k_u_p(1),   _c_o_m_p_r_e_s_s(1),
  1166.      _g_z_i_p(1), _z_c_a_t(1), _f_s_p(1), _a_r_c_h_i_e(1), _t_f_t_p(1).
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185. NCEMRSoft                 Last change:                         18
  1186.  
  1187.  
  1188.  
  1189.